package com.mysafe.provision.util.persistence;

import javax.inject.Singleton;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

@Singleton
public class EMFSingleton implements IEMFSingleton {

	EntityManagerFactory emf;
	EntityManagerLocator eml;
	
	public EMFSingleton() {
		this.emf = Persistence.createEntityManagerFactory("provision");
		this.eml = new EntityManagerLocator(emf);
	}
	
	@Override
	public EntityManagerFactory getEntityManagerFactory() {
		return emf;
	}
	
	@Override
	public EntityManagerLocator getEntityManagerLocator() {
		return eml;
	}
	
	
}
